﻿Imports Microsoft.VisualBasic
Imports System.Collections.Generic

Public Class shopCar

    Protected shopList As Dictionary(Of String, String)
    Public Function Add(ByVal p_list As String) As Boolean
        If shopList Is Nothing Then
            shopList = New Dictionary(Of String, String)
        End If
        Try
            shopList.Add(p_list, p_list)
            Add = True
        Catch ex As Exception
            Add = False
        End Try
    End Function

    Public Function GetShopCount() As Integer
        GetShopCount = IIf(shopList Is Nothing, 0, shopList.Count)
    End Function

    Public Function GetValues() As List(Of String)
        GetValues = New List(Of String)(shopList.Keys)
    End Function

    Public Sub RemoveValue(ByVal p_id As String)
        shopList.Remove(p_id)
    End Sub

End Class
